<#include "/common/include.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="字典树">
	<@cssLibs.ztree_css/>
	<style>
		body{height:auto;font-family: "Microsoft YaHei";}
		button{font-family: "SimSun","Helvetica Neue",Helvetica,Arial;}
	</style>
</@header>
<body class="hold-transition box box-main">
	<input id="columnId" type="hidden" value="${columnId}"/>
	<input id="treeId"   type="hidden" value="<#if dictHtml??>${dictHtml.id}</#if>"/>
	<input id="dictType" type="hidden" value="<#if dictHtml??>${dictHtml.dictType}</#if>"/>
	<div class="wrapper"><div class="treeShowHideButton" onclick="$.tree.toggleSearch();">
		<label id="btnShow" title="显示搜索" style="display:none;">︾</label>
		<label id="btnHide" title="隐藏搜索">︽</label>
	</div>
	<div class="treeSearchInput" id="search">
		<label for="keyword">关键字：</label><input type="text" class="empty" id="keyword" maxlength="50">
		<button class="btn" id="btn" onclick="$.tree.searchNode()"> 搜索 </button>
	</div>
    <div class="treeExpandCollapse">
        <a href="#" onclick="$.tree.expand()">展开</a> /
        <a href="#" onclick="$.tree.collapse()">折叠</a>
    </div>
	<div id="tree" class="ztree treeselect"></div>
	</div>
	<@footer>
	<@jsLibs.ztree_js/>
	<script>
		$(function() {
			var url = baseURL + "sys/dict/treeData";
			var options = {
		        url: url,
		        onClick : zOnClick,
				onCheck : onCheck
		    };
			$.tree.init(options);
		});
		
		function zOnClick(event, treeId, treeNode) {
		    $("#dictType").val(treeNode.name);
		}


		function onCheck(event, treeId, treeNode) {
			$("#dictType").val(treeNode.name);
		}
	</script>
</@footer>
</@pageTheme>